import type {
  MeetingNotifyTaskForm,
  MeetingNotifyTaskQuery,
  MeetingNotifyTaskVO,
} from './model';

import type { ID, IDS, PageResult } from '#/api/common';

import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';

/**
 * 分页查询会议通知任务列表
 * @param params
 * @returns 会议通知任务列表
 */
export function meetingNotifyTaskPage(params?: MeetingNotifyTaskQuery) {
  return requestClient.get<PageResult<MeetingNotifyTaskVO>>(
    '/meeting/notify/task/page',
    { params },
  );
}

/**
 * 查询会议通知任务列表
 * @param params
 * @returns 会议通知任务列表
 */
export function meetingNotifyTaskList(params?: MeetingNotifyTaskQuery) {
  return requestClient.get<MeetingNotifyTaskVO[]>('/meeting/notify/task/list', {
    params,
  });
}

/**
 * 导出会议通知任务列表
 * @param params
 * @returns 会议通知任务列表
 */
export function meetingNotifyTaskExport(params?: MeetingNotifyTaskQuery) {
  return commonExport('/meeting/notify/task/export', params ?? {});
}

/**
 * 查询会议通知任务详情
 * @param id id
 * @returns 会议通知任务详情
 */
export function meetingNotifyTaskInfo(id: ID) {
  return requestClient.get<MeetingNotifyTaskVO>(`/meeting/notify/task/${id}`);
}

/**
 * 新增会议通知任务
 * @param data
 * @returns void
 */
export function meetingNotifyTaskAdd(data: MeetingNotifyTaskForm) {
  return requestClient.postWithMsg<void>('/meeting/notify/task', data);
}

/**
 * 更新会议通知任务
 * @param data
 * @returns void
 */
export function meetingNotifyTaskUpdate(data: MeetingNotifyTaskForm) {
  return requestClient.putWithMsg<void>('/meeting/notify/task', data);
}

/**
 * 更新会议通知任务状态
 * @param data
 * @returns void
 */
export function meetingNotifyTaskUpdateStatus(data: MeetingNotifyTaskForm) {
  return requestClient.putWithMsg<void>(
    `/meeting/notify/task/changeStatus`,
    data,
  );
}

/**
 * 删除会议通知任务
 * @param id id
 * @returns void
 */
export function meetingNotifyTaskRemove(id: ID | IDS) {
  return requestClient.deleteWithMsg<void>(`/meeting/notify/task/${id}`);
}
